//---------------------------------------------------------------------------
#ifndef lab2H
#define lab2H
//---------------------------------------------------------------------------
#include <vcl\Classes.hpp>
#include <vcl\Controls.hpp>
#include <vcl\StdCtrls.hpp>
#include <vcl\Forms.hpp>
#include "grclient.h"
#include <vcl\ComCtrls.hpp>
#include <vcl\ExtCtrls.hpp>
#include <vcl\Buttons.hpp>
#include <vcl\Menus.hpp>
#include <vcl\Dialogs.hpp>
#include <vcl/inifiles.hpp>
#include <math.h>
//---------------------------------------------------------------------------



class TForm1 : public TForm
{
__published:	// IDE-managed Components
	TMainMenu *MainMenu1;
	TMenuItem *R21;
	TMenuItem *R31;
	TMenuItem *N1;
	TMainMenu *MainMenu2;
	TMenuItem *N2;
	TMenuItem *K1;
	TMenuItem *T1;
	TMainMenu *MainMenu3;
	TMenuItem *N4;
	TMenuItem *N5;
	TMenuItem *N6;
	TMenuItem *N7;
	TMenuItem *T2;
	TMenuItem *N8;
	TMenuItem *Tt1;
	TMainMenu *MainMenu4;
	TMenuItem *R22;
	TMenuItem *R32;
	TPageControl *PageControl1;
	TTabSheet *TabSheet1;
	TPanel *Panel1;
	TSpeedButton *SpeedButton1;
	TSpeedButton *SpeedButton3;
	TSpeedButton *SpeedButton4;
	TSpeedButton *SpeedButton5;
	TTabSheet *TabSheet2;
	TPanel *Panel2;
	TSpeedButton *SpeedButton2;
	TSpeedButton *SpeedButton6;
	TSpeedButton *SpeedButton7;
	TTabSheet *TabSheet4;
	TPanel *Panel3;
	TSpeedButton *SpeedButton8;
	TSpeedButton *SpeedButton9;
	TSpeedButton *SpeedButton10;
	TSpeedButton *SpeedButton11;
	TTabSheet *TabSheet5;
	TTabSheet *TabSheet6;
	TSpeedButton *SpeedButton13;
	TSpeedButton *SpeedButton14;
	TPanel *Panel4;
	TSpeedButton *SpeedButton15;
	TSpeedButton *SpeedButton16;
	TSpeedButton *SpeedButton17;
	TSpeedButton *SpeedButton18;
	TSpeedButton *SpeedButton19;
	TSpeedButton *SpeedButton20;
	TPanel *Panel5;
	TPanel *Panel7;
	TColorDialog *ColorDialog1;
	TMenuItem *N9;
	TMenuItem *N10;
	TMenuItem *N11;
	TMenuItem *N15;
	TMenuItem *N13;
	TMenuItem *N14;
	TStatusBar *StatusBar1;
	TFontDialog *FontDialog1;
	TFontDialog *FontDialog2;
	TFontDialog *FontDialog3;
	TFontDialog *FontDialog4;
	TStatusBar *StatusBar2;
	TStatusBar *StatusBar3;
	TStatusBar *StatusBar5;
	TPopupMenu *PopupMenu1;
	TMenuItem *N15;
	TMenuItem *N16;
	TMenuItem *N17;
	TMenuItem *N18;
	TMenuItem *N19;
	TMainMenu *MainMenu5;
	TMenuItem *N20;
	TPanel *Panel6;
	TLabel *Label1;
	TLabel *Label2;
	TLabel *Label3;
	TLabel *Label4;
	TLabel *Label5;
	TLabel *Label6;
	TLabel *Label7;
	TPanel *Panel8;
	TLabel *Label8;
	TLabel *Label9;
	TLabel *Label10;
	TLabel *Label11;
	TLabel *Label12;
	TEdit *Edit17;
	TTimer *Timer1;
	TEdit *Edit18;
	TEdit *Edit19;
	TEdit *Edit20;
	TMenuItem *N21;
	TMenuItem *N22;
	TMenuItem *N23;
	TMenuItem *N24;
	TMenuItem *N25;
	TPanel *Panel12;
	TImage *Image1;
	TImage *Image2;
	TPanel *Panel13;
	TImage *Image3;
	TMenuItem *N26;
	TSpeedButton *SpeedButton21;
	TSpeedButton *SpeedButton22;
	TMenuItem *N27;
	TSpeedButton *SpeedButton23;
	TMenuItem *N28;
	TSpeedButton *SpeedButton24;
	TMenuItem *N29;
	TPanel *Panel9;
	TPanel *Panel10;
	TGroupBox *GroupBox1;
	TEdit *Edit1;
	TButton *Button1;
	TEdit *Edit2;
	TEdit *Edit3;
	TEdit *Edit4;
	TButton *Button2;
	TButton *Button3;
	TButton *Button4;
	TGroupBox *GroupBox2;
	TEdit *Edit5;
	TButton *Button5;
	TEdit *Edit6;
	TEdit *Edit7;
	TEdit *Edit8;
	TButton *Button6;
	TButton *Button7;
	TButton *Button8;
	TGroupBox *GroupBox3;
	TEdit *Edit9;
	TButton *Button9;
	TEdit *Edit10;
	TEdit *Edit11;
	TEdit *Edit12;
	TButton *Button10;
	TButton *Button11;
	TButton *Button12;
	TPanel *Panel11;
	TGroupBox *GroupBox4;
	TEdit *Edit13;
	TEdit *Edit14;
	TEdit *Edit15;
	TEdit *Edit16;
	TButton *Button13;
	TButton *Button14;
	TButton *Button15;
	TButton *Button16;
	TSpeedButton *SpeedButton25;
	TSpeedButton *SpeedButton26;
	TMenuItem *N30;
	TEdit *Edit21;
	TTabSheet *TabSheet3;
	TPanel *Panel14;
	TSpeedButton *SpeedButton27;
	TSpeedButton *SpeedButton28;
	TSpeedButton *SpeedButton29;
	TEdit *Edit22;
	TMainMenu *MainMenu6;
	TMenuItem *N31;
	TMenuItem *N32;
	TMenuItem *N33;
	TPanel *Panel15;
	TImage *Image4;
	TStatusBar *StatusBar4;
	void __fastcall SpeedButton1Click(TObject *Sender);
	void __fastcall PageControl1Change(TObject *Sender);
	void __fastcall FormClose(TObject *Sender, TCloseAction &Action);
	void __fastcall FormShow(TObject *Sender);
	void __fastcall SpeedButton4Click(TObject *Sender);
	void __fastcall SpeedButton3Click(TObject *Sender);
	void __fastcall SpeedButton5Click(TObject *Sender);
	void __fastcall SpeedButton6Click(TObject *Sender);
	void __fastcall SpeedButton7Click(TObject *Sender);
	void __fastcall SpeedButton9Click(TObject *Sender);
	void __fastcall SpeedButton10Click(TObject *Sender);
	void __fastcall SpeedButton11Click(TObject *Sender);
	void __fastcall SpeedButton13Click(TObject *Sender);
	void __fastcall SpeedButton19Click(TObject *Sender);
	void __fastcall SpeedButton20Click(TObject *Sender);
	void __fastcall SpeedButton16Click(TObject *Sender);
	void __fastcall SpeedButton17Click(TObject *Sender);
	void __fastcall SpeedButton18Click(TObject *Sender);


	void __fastcall Button13Click(TObject *Sender);
	void __fastcall Button14Click(TObject *Sender);
	void __fastcall Button15Click(TObject *Sender);
	void __fastcall Button16Click(TObject *Sender);
	void __fastcall Button1Click(TObject *Sender);
	void __fastcall Button2Click(TObject *Sender);
	void __fastcall Button3Click(TObject *Sender);
	void __fastcall Button4Click(TObject *Sender);
	void __fastcall Button10Click(TObject *Sender);
	void __fastcall Button11Click(TObject *Sender);
	void __fastcall Button12Click(TObject *Sender);
	void __fastcall Button5Click(TObject *Sender);
	void __fastcall Button9Click(TObject *Sender);
	void __fastcall Button6Click(TObject *Sender);
	void __fastcall Button7Click(TObject *Sender);
	void __fastcall Button8Click(TObject *Sender);
	void __fastcall FormResize(TObject *Sender);
	void __fastcall N17Click(TObject *Sender);
	void __fastcall Timer1Timer(TObject *Sender);
	void __fastcall SpeedButton21Click(TObject *Sender);
	void __fastcall SpeedButton22Click(TObject *Sender);
	void __fastcall SpeedButton23Click(TObject *Sender);
	void __fastcall SpeedButton24Click(TObject *Sender);
	void __fastcall SpeedButton26Click(TObject *Sender);
	void __fastcall SpeedButton28Click(TObject *Sender);
private:	// User declarations
 void LabCreatGrClient(TGrClient **Client, char *Title,
    int x1, int y1, int x2, int y2,
    TFont *Font, TColor ColFon);
 void  LabMenu(int *Pos, char *Items[], int Count,
       int X, int Y, int FlagSize);
 int MessBox(char *Text, char *Title, int Flag);
 void Wait(int X, int Y, char *Text);
 void ShowBMP(char *File, char *Title);
 void ClearS();
 TColor GetColor(TColor Color);
 bool GetFont(int NumberFont);
 int  NumbersCharToInt(char *a,int *m, int kch, int kc);
 bool LoadINI();
 void AnswerError(char *q);
 void AnswerGood(char *q);
 int ReadIniString(TIniFile *WIniFile,
                  char *SectionName,
                  char *KeyName,
                  char *Value);
int WriteIniString(char *IniFileName,
                   char *SectionName,
                   char *KeyName,
                   char *Value);




 void CmLineR2();
 void CmLineR3();
 void CmNoLine();
 void CmOtobR2();
 void CmOtobR3();
 void CmOprQ();
 void CmNalgoritm();
 void CmKalgoritm();
 void ka_z1();
 void ka_z2();
 void CmTmulti();
 void CmToZ1();
 void CmToZ2();
 void CmToOpr();
 void CmToChicl();
 void CmToQ();
 void CmChiclQ();








int XGC, YGC, GW, GH;
int SizeTextX, SizeTextY;
double v1_1, u1_1, v1_2, u1_2;
double u1_, u2_, v2, qu, qu_, qv, qv_, q;
double  pru, prv;
double fx[5], fy[5], fz[5], fxn[200], fyn[200];
double fx2[5], fy2[5];
int n, mchi;
double sq;
double u2, v2_, u1, v1_, u_, v0, u_1, v_1, u_2, v_2;
double E, h;
int FlagNumberMouse;
double v1, u, v_, u0, v01;
int FlagFull, Flag1, Flag2, Flag3, Flag4, Flag5, Flag6, Flag7, Flag8, Flag9;
double maxx, minx, maxy, miny, maxz, stepx, stepy, stepz;
double A, B, C, D;
int x1, y1, x2, y2;
TColor ColorFonScreen;
TColor ColorFonGr;

TColor ColorLine1;
TColor ColorLine2;
TColor ColorLine3;
TColor ColorLine4;
TColor ColorMarker1;
TColor ColorMarker2;
TColor ColorMarker3;
TColor ColorMarker4;
TColor ColorOrigin;


public:		// User declarations
	__fastcall TForm1(TComponent* Owner);

 int FlagLanguage;  // 0 - Russian, 1 - English
 TColor ColorFonValue;
 TGrClient *pPopup;
 TGrClient *pValue;
 TGrClient *p1;
 TColor MenuFon;
};
//---------------------------------------------------------------------------
extern TForm1 *Form1;
//---------------------------------------------------------------------------
#include "global.h"
#include "labmenu1.h"
#include "linr2_f1.h"
#include "Value21.h"
#include "messbox1.h"
#include "wait1.h"
#include "linr3_f1.h"
#include "aij1.h"
#include "value31.h"
#include "value41.h"
#include "nolin1.h"
#include "otobr2f1.h"
#include "otobr31.h"
#include "opr_q11.h"
#include "opr_q21.h"
#include "opr_q2e1.h"
#include "opr_q31.h"
#include "opr_q41.h"
#include "opr_q4e1.h"
#include "opr_q51.h"
#include "opr_q5a1.h"
#include "value11.h"
#include "na_q11.h"
#include "norma_b1.h"
#include "na_f1.h"
#include "ka_q11.h"
#include "ka_q21.h"
#include "ka_q2e1.h"
#include "ka_q31.h"
#include "ka_q41.h"
#include "ka_q4e1.h"
#include "k_z11.h"
#include "k_z1_f1.h"
#include "k_z1sdu1.h"
#include "k_z1ip1.h"
#include "k_z1mi1.h"
#include "k_z2_f1.h"
#include "tm_ex1.h"
#include "tm_f1.h"
#include "bmp1.h"
#include "value161.h"
#include "to_alg1.h"
#include "to_uv61.h"
#include "to_uv31.h"
#include "to_uk1.h"
#include "value71.h"
#include "val211.h"
#include "to_q11.h"
#include "to_q21.h"
#include "to_q31.h"
#include "to_q41.h"
#include "to_z31.h"
#include "about1.h"
#include "qerr1.h"
#include "large1.h"
#include "t_q21.h"
#include "to_opr11.h"
#include "help1.h"
#include "to_uk21.h"
#include "lr2v1.h"
#include "or3v1.h"
#include "or3va1.h"
#include "kaz1v1.h"
#include "toz2f1.h"
#include "toz2v1.h"
#include "lr3v1.h"
#include "nolv1.h"
#include "otr2v1.h"

#endif
